package com.atguigu.cloud.controller;

import cn.hutool.core.util.IdUtil;
import com.atguigu.cloud.entities.Pay;
import com.atguigu.cloud.resp.ResultData;
import com.atguigu.cloud.service.PayService;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayGatewayController {
    @Resource
    private PayService payService;

    @GetMapping("/pay/gateway/get/{id}")
    public ResultData getById(HttpServletRequest request, @PathVariable("id") Integer id){
        Pay byId = payService.getById(id);
        return ResultData.success(byId);
    }
    @GetMapping("/pay/gateway/info")
    public ResultData getGatewayInfo(HttpServletRequest request){
        return ResultData.success("gateway info test: " + IdUtil.simpleUUID());
    }

    @GetMapping("/pay/gateway/filter")
    public ResultData a(HttpServletRequest request){
        return ResultData.success("sdfsdfsdf");
    }

}
